package org.libermundi.theorcs.chronicles.services.message;

import java.util.List;

import org.libermundi.theorcs.chronicles.model.message.Channel;
import org.libermundi.theorcs.chronicles.model.message.Message;
import org.libermundi.theorcs.core.model.base.NumericIdEntity;

/**
 * ChainService for message.
 * It is characterized by the type of Message and the type of Entity who used it. 
 * As a Persona uses an InternalEmail, a User an ExternalEmail...
 *
 * @param <T>
 */
public interface MessageChainService<T extends Message, T1 extends NumericIdEntity> {
	
	/**
	 * Process the message to be dispatch to targets by channel
	 * @param message
	 * @param channel
	 * @param targets
	 * @return true if ok, else false 
	 */
	boolean process(T message, Channel channel);

	/**
	 * TODO Delete before prod
	 */
	void initialize();

	List<T> getEntityMessages(T1 numericId);
	
	T getEntityMessage(long numericId);
}
